import java.util.Scanner;

public class ThreadDemo8 {
   volatile static int fal=0;
    public static void main(String[] args) {
        Thread t =new Thread(() ->{
           while(fal==0){
           }
            System.out.println("循环结束");
        });
        Thread t1 =new Thread(() ->{
            Scanner scanner =new Scanner(System.in);
            System.out.println("请输入大于0得数:");
            fal= scanner.nextInt();
        });
        t.start();
        t1.start();
    }
}
